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6,3,7,4,7,5,7
200 DIM FLAG(7,7)
210 LV=1
300 REM LVM FLAG(7,7)
1000 CLS:GRAPH:LOCATE 3,8:PRINT "第 ";LV;" 关"
1010 C$=INKEY$
1100 CLS:GRAPH
1110 FOR I=1 TO 3: FOR J=1 TO 2
1120 BOX I*11+15,J*11-9,I*11+22,J*11-2
1130 BOX I*11+15,J*11+46,I*11+22,J*11+53
1140 NEXT :NEXT 
1200 FOR I=1 TO 7: FOR J=1 TO 3
1210 BOX I*11-7,J*11+13,I*11,J*11+20
1220 NEXT :NEXT 
2000 READ S
2010 FOR I=1 TO 7
2020 FOR J=1 TO 7
2030 FLAG(I,J)=0
2040 NEXT :NEXT 
2100 FOR I=1 TO S
2110 READ T1,T2
2120 FLAG(T1,T2)=1
2130 BOX T1*11-6,T2*11-8,T1*11-1,T2*11-3,1,2
2140 NEXT 
2300 X=4:Y=4
2310 BOX X*11-9,Y*11-11,X*11+2,Y*11
2400 C$=INKEY$
2410 IF C$=CHR$(20) THEN 2420 ELSE 2600
2420 IF TY=1 THEN 2500 ELSE 2430
2430 IF X<3 AND Y=3 THEN 2400
2440 IF X>5 AND Y=3 THEN 2400
2450 IF Y=1 THEN 2400
2460 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
2470 Y=Y-1: GOTO 2310
2500 IF Y=5 OR (X<6 AND X>2 AND Y>2) THEN 2510 ELSE 2400
2510 IF FLAG(X,Y-1)=1 AND FLAG(X,Y-2)=0 THEN 2550 ELSE 2400
2550 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2
2560 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
2570 FLAG(X,Y-1)=0:FLAG(X,Y)=0:S=S-1:Y=Y-2:FLAG(X,Y)=1:TY=0
2580 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2:BOX X*11-6,Y*11+3,X*11-1,Y*11+8,1,2
2590 IF S=1 THEN 8000 ELSE 2310
2600 IF C$=CHR$(21) THEN 2610 ELSE 2800
2610 IF TY=1 THEN 2700
2620 IF (X<3 OR X>5) AND Y=5 THEN 2400
2630 IF Y=7 THEN 2400
2640 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
2650 Y=Y+1: GOTO 2310
2700 IF Y=3 OR (X<6 AND X>2 AND Y<6) THEN 2710 ELSE 2400
2710 IF FLAG(X,Y+1)=1 AND FLAG(X,Y+2)=0 THEN 2750 ELSE 2400
2750 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2
2760 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
2770 FLAG(X,Y+1)=0:FLAG(X,Y)=0:S=S-1:Y=Y+2:FLAG(X,Y)=1:TY=0
2780 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2:BOX X*11-6,Y*11-19,X*11-1,Y*11-14,1,2
2790 IF S=1 THEN 8000 ELSE 2310
2800 IF C$=CHR$(23) THEN 2810 ELSE 3000
2810 IF TY=1 THEN 2900
2820 IF (Y<3 OR Y>5) AND X=3 THEN 2400
2830 IF X=1 THEN 2400
2840 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
2850 X=X-1: GOTO 2310
2900 IF X=5 OR (Y<6 AND Y>2 AND X>2) THEN 2910 ELSE 2400
2910 IF FLAG(X-1,Y)=1 AND FLAG(X-2,Y)=0 THEN 2950 ELSE 2400
2950 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2
2960 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
2970 FLAG(X-1,Y)=0:FLAG(X,Y)=0:S=S-1:X=X-2:FLAG(X,Y)=1:TY=0
2980 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2:BOX X*11+5,Y*11-8,X*11+10,Y*11-3,1,2
2990 IF S=1 THEN 8000 ELSE 2310
3000 IF C$=CHR$(22) THEN 3010 ELSE 3200
3010 IF TY=1 THEN 3100
3020 IF (Y<3 OR Y>5) AND X=5 THEN 2400
3030 IF X=7 THEN 2400
3040 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
3050 X=X+1: GOTO 2310
3100 IF X=3 OR (Y<6 AND Y>2 AND X<6) THEN 3110 ELSE 2400
3110 IF FLAG(X+1,Y)=1 AND FLAG(X+2,Y)=0 THEN 3150 ELSE 2400
3150 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2
3160 BOX X*11-9,Y*11-11,X*11+2,Y*11,0,0
3170 FLAG(X+1,Y)=0:FLAG(X,Y)=0:S=S-1:X=X+2:FLAG(X,Y)=1:TY=0
3180 BOX X*11-6,Y*11-8,X*11-1,Y*11-3,1,2:BOX X*11-17,Y*11-8,X*11-12,Y*11-3,1,2
3190 IF S=1 THEN 8000 ELSE 2310
3200 IF C$=CHR$(13) THEN 3210 ELSE IF C$=CHR$(27) THEN END ELSE 2400
3210 IF FLAG(X,Y)=1 THEN 3220 ELSE 2400
3220 IF TY=1 THEN TY=0: GOTO 2400
3230 TY=0
3240 IF Y=5 OR (X<6 AND X>2 AND Y>2) THEN 3250 ELSE 3300
3250 IF FLAG(X,Y-1)=1 AND FLAG(X,Y-2)=0 THEN TY=1: GOTO 2400
3300 IF Y=3 OR (X<6 AND X>2 AND Y<6) THEN 3310 ELSE 3350
3310 IF FLAG(X,Y+1)=1 AND FLAG(X,Y+2)=0 THEN TY=1: GOTO 2400
3350 IF X=5 OR (Y<6 AND Y>2 AND X>2) THEN 3360 ELSE 3400
3360 IF FLAG(X-1,Y)=1 AND FLAG(X-2,Y)=0 THEN TY=1: GOTO 2400
3400 IF X=3 OR (Y<6 AND Y>2 AND X<6) THEN 3410 ELSE 3450
3410 IF FLAG(X+1,Y)=1 AND FLAG(X+2,Y)=0 THEN TY=1: GOTO 2400
3450 GOTO 2400
8000 CLS:GRAPH:LOCATE 2,8:PRINT "恭喜你":LOCATE 3,1:PRINT "成功过关,加油继续吧"
8010 LV=LV+1:C$=INKEY$
8020 GOTO 1000
